package Thread;

import java.util.Random;

public class ThreeThreadTest {
	static Random random = new Random();
	static int count = 0 ;
	public static void main(String[] args) {
		new One().start();
		new Two().start();
		new Three().start();
		
	}
	static class One extends Thread{
		@Override
		public void run(){
			while(true){
				System.out.print(".");
				
				try{
					Thread.sleep(random.nextInt(91)+10);
				}catch (InterruptedException e) {
					e.printStackTrace();
				}
				
				ThreeThreadTest.count++;
				if(ThreeThreadTest.count>100) break;
				
			}
		}
	}
	static class Two extends Thread{
		@Override
		public void run(){
			while(true){
				System.out.print("#");
				
				try{
					Thread.sleep(random.nextInt(91)+10);
				}catch (InterruptedException e) {
					e.printStackTrace();
				}

				ThreeThreadTest.count++;
				if(ThreeThreadTest.count>100) break;
			}
		}
	}
	static class Three extends Thread{
		@Override
		public void run(){
			while(true){
				System.out.print("@");
				
				try{
					Thread.sleep(random.nextInt(91)+10);
				}catch (InterruptedException e) {
					e.printStackTrace();
				}
				
				ThreeThreadTest.count++;
				if(ThreeThreadTest.count>100) break;
				
			}
		}
	} 

}
